A solid state disk (SSD) is a hard disk manufactured by using a solid-state electronic memory chip array, and is formed by a control unit and a storage unit. The storage unit is formed by a Flash chip. Due to factors of process and cost, a certain fault rate is caused to the Flash chip; when a Flash chip fails, stored data is damaged. Therefore, a method for recovering erroneous data is widely concerned.
At present, a method for recovering erroneous data is that: when data in a storage block that is included in a Flash chip of an SSD is read, for a certain page in the storage block, erroneous data on the page is checked. If the number of pieces of erroneous data does not exceed a preset first threshold, an error checking and correction (ECC) recovery is performed on the erroneous data on the page and correct data is returned. If the number of pieces of erroneous data exceeds the preset first threshold, the storage block is labeled as a bad block and the storage block will not be used subsequently. Meanwhile, a page having a same page identity as that of the page is selected from a preset number of storage blocks and, it is determined, according to data on the selected page, whether a redundant array of independent disks (RAID) recovery can be performed on the data of the page. If it is determined to perform a RAID recovery on the data of the page, a RAID recovery is performed on the page and correct data is returned; otherwise, data reading is wrong.
In a process of implementing the present invention, the inventor finds the prior art at least has the following problems.
When the number of pieces of erroneous data on a certain page exceeds the preset first threshold, only a RAID recovery can be performed on the storage block. However, a RAID recovery needs to be performed according to the data in the preset number of storage blocks, and time for recovering data is long and efficiency is low. Moreover, after the whole storage block is labeled as a bad block, a capacity of the SSD is reduced, and only a storage block not labeled as a bad block can be used subsequently, which causes that the storage block not labeled as a bad block is frequently used, thereby shortening a service life and deteriorating performance of the SSD.